package com.tyx.chargingpile.service;

import com.tyx.chargingpile.dao.ChargingRecordDao;
import com.tyx.chargingpile.pojo.ChargingRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ChargingRecordService {

    @Autowired
    private ChargingRecordDao chargingRecordDao;

    public void add(ChargingRecord chargingRecord){
        chargingRecordDao.save(chargingRecord);
    }

    public List<ChargingRecord> findBySendStatusIn(List<String> sendStatus){
        return chargingRecordDao.findBySendStatusIn(sendStatus);
    }

    public List<ChargingRecord> saveOrUpdate(List<ChargingRecord> list){
        return chargingRecordDao.saveAll(list);
    }
}
